package com.helloniu.wb {

import mx.managers.CursorManager;
import com.helloniu.fl.util.StyleTool;
import com.helloniu.fl.util.Tool;

public class CursorManager2 {
    public function CursorManager2() {
    }

    public static function setCursor(cursor:Number):void {
        if(currCursor == cursor) {
            return;
        }

        currCursor = cursor;

        if(cursor == MOVE_CURSOR) {
            CursorManager.setCursor(StyleTool.getStyle("move8Icon"), 2, -6, -6);
        }
        else if(cursor == RESIZE_07_CURSOR) {
        	CursorManager.setCursor(StyleTool.getStyle("resize07Icon"), 2, -6, -6);
        }
        else if(cursor == RESIZE_16_CURSOR) {
        	CursorManager.setCursor(StyleTool.getStyle("resize16Icon"), 2, -6, -6);
        }
        else if(cursor == RESIZE_25_CURSOR) {
        	CursorManager.setCursor(StyleTool.getStyle("resize25Icon"), 2, -6, -6);
        }
        else if(cursor == RESIZE_34_CURSOR) {
        	CursorManager.setCursor(StyleTool.getStyle("resize34Icon"), 2, -6, -6);
        }
    }

    private static var currCursor:Number;

    public static function removeCursor():void {
        if(currCursor == -1 || isNaN(currCursor)) {
            return;
        }

        currCursor = -1;
        CursorManager.removeCursor(CursorManager.currentCursorID);
    }


    public static function isPainting():Boolean {
        return tooltype >= 0x00 && tooltype <= 0x09;
    }

    public static function setToolType(tooltype0:Number):void {
        tooltype = tooltype0;
    }

    public static function getToolType():Number {
        return tooltype;
    }

    private static var tooltype:Number = -1;

    // TOOL TYPE
    public static const PAINT_PEN:Number = 0x00;
    public static const PAINT_LINE:Number = 0x01;
    public static const PAINT_RECT:Number = 0x02;
    public static const PAINT_ELLIPSE:Number = 0x03;
    public static const PAINT_TEXT:Number = 0x04;
    public static const PAINT_RRECT:Number = 0x05;
    
    
    public static const PAINT_NONE:Number = 0x30;
    public static const PAINT_LASER:Number = 0x40;
    
    // CURSOR TYPE    
    public static const MOVE_CURSOR:Number = 0x10;// tool & cursor
    public static const MOVE_TOOL:Number = 0x10;// tool & cursor
    public static const RESIZE_MOVE_CURSOR:Number = 0x11;
    public static const MODIFY_TOOL:Number = 0x11;
    
    public static const RESIZE_07_CURSOR:Number = 0x20;
    public static const RESIZE_16_CURSOR:Number = 0x21;
    public static const RESIZE_25_CURSOR:Number = 0x22;
    public static const RESIZE_34_CURSOR:Number = 0x23;    
}
}